package com.hst.capacity.infra.convertor;

import com.hst.capacity.domain.model.entity.order.express.ExpressOrderDestroyEntity;
import com.hst.capacity.domain.model.entity.order.express.ExpressOrderEntity;
import com.hst.capacity.domain.model.entity.order.intercity.IntercityOrderDestroyEntity;
import com.hst.capacity.domain.model.entity.order.specialcar.SpCarOrderDestroyEntity;
import com.hst.capacity.domain.model.request.express.ExOrderDestroyParam;
import com.hst.capacity.domain.model.request.intercity.IcOrderDestroyParam;
import com.hst.capacity.domain.model.request.specialcar.SpOrderDestroyParam;
import com.hst.capacity.domain.model.response.PagingResultVO;
import com.hst.capacity.domain.model.response.express.ExListNewVO;
import com.hst.capacity.domain.model.response.express.ExSearchVO;
import com.hst.capacity.domain.model.response.order.ExOrderInfoVO;
import com.hst.capacity.domain.model.response.order.OrderVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 *  快车订单模块的POJO属性转换器
 *
 * @author jin
 * */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ExpressConvertor {
    ExpressConvertor INSTANCE = Mappers.getMapper(ExpressConvertor.class);

    PagingResultVO<ExListNewVO> convertNew(PagingResultVO<ExpressOrderEntity> expressOrderEntity);

    PagingResultVO<ExSearchVO> convertSearch(PagingResultVO<ExpressOrderEntity> expressOrderEntity);


    ExpressOrderDestroyEntity convert(ExOrderDestroyParam param);

    IntercityOrderDestroyEntity convert(IcOrderDestroyParam param);

    SpCarOrderDestroyEntity convert(SpOrderDestroyParam param);

    @Mapping(target="appointmentTime", dateFormat="yyyy-MM-dd HH:mm")
    ExOrderInfoVO convert(ExpressOrderEntity entity);

    @Mapping(target="appointmentTime", dateFormat="yyyy-MM-dd HH:mm")
    OrderVO convert2VO(ExpressOrderEntity entity);

}
